package org.nbict.iot.task.realtime.map;

import org.apache.storm.trident.operation.MapFunction;
import org.apache.storm.trident.tuple.TridentTuple;
import org.apache.storm.tuple.Values;

/**
 * Created by songseven on 18/6/28.
 */
public class GisDeviceStatusMap implements MapFunction {

    @Override
    public Values execute(TridentTuple tuple) {
        Integer status = 1;
        if (tuple.getInteger(2) == 1) status = 0; //登入 0在线 1离线
        return new Values(tuple.get(1), tuple.get(3), status);
    }
}
